<!-- Start of first page -->
<div data-role="page">
    <script>
        $(function(){
            setTimeout('initialize()',500);
        });
    </script>


    <div data-role="header" data-theme="a">
        <?php echo CHtml::link("Back",array("site/index"),array("data-icon"=>"back"))?>
        <h3>Register</h3>
    </div>

    <div data-role="content" data-theme="a">
    <p>Please fill out the following form with your login credentials:</p>

    <div class="form">
     <?php $form=$this->beginWidget('CActiveForm', array(
      'id'=>'registration-form',
      'enableClientValidation'=>true,
      'clientOptions'=>array(
        'validateOnSubmit'=>true,
       ),
    )); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo CHtml::errorSummary(array($business, $subscription,$account)); ?>
    <!-- business information -->
    <div class="row">
        <?php echo $form->labelEx($business,'business_name'); ?>
        <?php echo $form->textField($business,'business_name',array('size'=>50,'maxlength'=>50)); ?>
        <?php echo $form->error($business,'business_name'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($business,'tel_no'); ?>
        <?php echo $form->textField($business,'tel_no',array('size'=>20,'maxlength'=>20)); ?>
        <?php echo $form->error($business,'tel_no'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($business,'mobile_no'); ?>
        <?php echo $form->textField($business,'mobile_no',array('size'=>30,'maxlength'=>30)); ?>
        <?php echo $form->error($business,'mobile_no'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($business,'address'); ?>
        <?php echo $form->textField($business,'address',array('size'=>60,'maxlength'=>100, 'value'=>"Fetching your current location...")); ?>
        <?php echo $form->error($business,'address'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($business,'business_type'); ?>
        <?php echo $form->dropDownList($business,'business_type',array('Food and Beverage'=>'Food and Beverage','Retail'=>'Retail','Entertainment'=>'Entertainment'), array('data-native-menu' => "false")); ?>
        <?php echo $form->error($business,'business_type'); ?>
    </div>

    <!-- subscription information -->
    <div class="row">
        <?php echo $form->labelEx($subscription,'subscription_type'); ?>
        <?php echo $form->dropDownList($subscription, 'subscription_type', array('3 Month'=>'3 Month','6 Month'=>'6 Month','12 Month'=>'12 Month'), array('data-native-menu' => "false")); ?>
        <?php echo $form->error($subscription,'subscription_type'); ?>
    </div>

    <!-- account information -->
    <div class="row">
        <?php echo $form->labelEx($account,'username'); ?>
        <?php echo $form->textField($account,'username'); ?>
        <?php echo $form->error($account,'username'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($account,'password'); ?>
        <?php echo $form->passwordField($account,'password'); ?>
        <?php echo $form->error($account,'password'); ?>
        <p class="hint">
            Hint: Please make sure your create a strong password such as: <tt>testuser/Testpass1</tt> or <tt>testAdmin/Adminpass1</tt>.
        </p>
    </div>

    <div class="row">
        <?php echo $form->labelEx($account,'email'); ?>
        <?php echo $form->textField($account,'email'); ?>
        <?php echo $form->error($account,'email'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton('Register'); ?>
    </div>

    <?php $this->endWidget(); ?>
    </div><!-- form -->
    </div><!-- content -->

    <?php $this->renderPartial("//site/footer")?>
    <!-- /footer -->
</div>
<!-- /page -->
